package com.syahrir.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.envers.Audited;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * TestStudent generated by irays
 */
@SuppressWarnings("serial")
@Entity
@Table(name="test_student")
@Audited
public class TestStudent implements java.io.Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="SEQ_TESTSTUDENT")
	@SequenceGenerator(name="SEQ_TESTSTUDENT", sequenceName="SEQ_TESTSTUDENT", allocationSize=1)
	@Column(name="ID", unique=true, nullable=false)
	private int id;
	
	@NotNull
	@Length(max=45, message="{validator.long}")
	@Column(name="NAME", length=45)
	private String name;
	
	@Length(max=45, message="{validator.long}")
	@Column(name="ADDRESS", length=45)
	private String address;
	
	@Length(max=1, message="{validator.long}")
	@Column(name="GENDER", length=1)
	private String gender;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="DOB", length=7)
	private Date dob;
	
	@Length(max=45, message="{validator.long}")
	@Column(name="EMAIL", length=45)
	private String email;
	
	@Length(max=15, message="{validator.long}")
	@Column(name="MOBILE", length=15)
	private String mobile;
	
	@Length(max=15, message="{validator.long}")
	@Column(name="PHONE", length=15)
	private String phone;

	public TestStudent() {
		//default constructor
	}

	public TestStudent(int id, String name, String address,
			String gender, Date dob, String email, String mobile, String phone) {
		this.setId(id);
		this.setName(name);
		this.setAddress(address);
		this.setGender(gender);
		this.setDob(dob);
		this.setEmail(email);
		this.setMobile(mobile);
		this.setPhone(phone);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Date getDob() {
		return dob;
	}

	public void setDob(Date dob) {
		this.dob = dob;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

}
